<template>
  <div>
    <el-row :gutter="20">
      <div class="app-container">
        <el-row type="flex" justify="start" align="middle">
          <el-col :span="2"
            ><span class="el-custom-title"
              >生产工序线</span
            ></el-col
          >
          <el-col :span="15" style="font-size:13px;">
            <span>编号: </span>
            <el-autocomplete
              class="inline-input"
              style="max-width:120px;font-size:13px;"
              v-model="selectedNo"
              :fetch-suggestions="querySearch"
              placeholder="请输入编号"
              @select="handleSelect"
              @input="handleInput"
            ></el-autocomplete>
            <span>更新时间: </span>
            <el-date-picker
              style="max-width:240px;font-size:13px;"
              v-model="selectedDatetimeRange"
              type="datetimerange"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              @change="handleDateSelectChange"
            >
            </el-date-picker>
            <span>状态: </span>
            <el-select
              v-model="queryConditions.status"
              placeholder="请选择"
              style="max-width:120px;font-size:13px;"
            >
              <el-option
                v-for="itm in lstStatus"
                :label="itm.label"
                :value="itm.value"
                :key="itm.value"
              ></el-option>
            </el-select>
          </el-col>
          <el-col :span="7" style="float:right;">
            <el-button-group>
              <el-button
                type="primary"
                icon="el-icon-search"
                class="el-button--mini"
                @click="ui_query"
                >查询</el-button
              >
              <el-button
                type="primary"
                icon="el-icon-plus"
                class="el-button--mini"
                @click="handleCreate"
                >添加</el-button
              >
              <el-button
                type="primary"
                size="mini"
                icon="el-icon-edit"
                @click="handleUpdate()"
              >
                编辑
              </el-button>
              <el-button
                size="mini"
                type="danger"
                icon="el-icon-delete"
                @click="ui_delete(null, null)"
              >
                删除
              </el-button>
            </el-button-group>
            <el-button-group>
              <el-button
                size="mini"
                type="primary"
                icon="el-icon-s-check"
                @click="ui_auditing()"
              >
                提交审核
              </el-button>
              <el-button
                size="mini"
                type="primary"
                icon="el-icon-s-check"
                ref="btnAudited"
                @click="ui_audited(null, null)"
                >审核</el-button
              >
              <el-button
                size="mini"
                type="primary"
                icon="el-icon-document-copy"
                @click="ui_copy(null, null)"
              >
                复制
              </el-button>
              <el-button
                size="mini"
                type="primary"
                icon="el-icon-download"
                @click="ui_dispatch()"
              >
                下发
              </el-button>
            </el-button-group>
          </el-col>
        </el-row>
        <el-row type="flex" justify="start">
          <el-table
            v-loading="listLoading"
            :data="list"
            element-loading-text="Loading"
            border
            fit
            highlight-current-row
            @row-click="rowClick"
            @selection-change="handleSelectionChange"
          >
            >
            <el-table-column type="selection" width="55"></el-table-column>
            <el-table-column
              align="center"
              label="工序线编号"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.produceProcedureNo }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="工序线名称"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.produceProcedureName }}
              </template>
            </el-table-column>
             <el-table-column
              align="center"
              label="支线编号"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.produceLineBranchNo }}
              </template>
            </el-table-column>

                  <el-table-column
              align="center"
              label="支线名称"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.produceLineBranchName }}
              </template>
            </el-table-column>
           
            <el-table-column
              align="center"
              label="产品类型"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.productTypeName }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="状态"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ resolveStatusValue(scope.row.status) }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="备注"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.comment }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="审核时间"
              width="100"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.audittime | formatDate }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="审核人"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.audituser }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="创建时间"
              width="100"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.createtime | formatDate }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="创建人"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.createuser }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="更新时间"
              width="100"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.updatetime | formatDate }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="更新人"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.updateuser }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="删除时间"
              width="100"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.deletetime | formatDate }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="删除人"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.deleteuser }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="来源"
              width="95"
              style="display:none;"
            >
              <template slot-scope="scope">
                {{ scope.row.source }}
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              label="是否已删除"
              width="95"
              style="display:none;"
              v-if="false"
            >
              <template slot-scope="scope">
                {{ scope.row.isdeleted }}
              </template>
            </el-table-column>
          </el-table>
        </el-row>
        <el-row>
          <pagination
            v-show="total > 0"
            :total="total"
            :page.sync="listQuery.page"
            :limit.sync="listQuery.limit"
            :page-sizes="listQuery.pageSizes"
            @pagination="fetchData"
          />
        </el-row>
      </div>
    </el-row>
    <el-row>
      <el-tabs type="border-card">
        <el-tab-pane label="工序支线">
          <mesprocedurebranchchild
            :mesproduceprocedureid="
              this.lstSelected != null && this.lstSelected.length > 0
                ? this.lstSelected[0].id
                : 0
            "
          ></mesprocedurebranchchild>
        </el-tab-pane>
        <el-tab-pane label="工序">
          <mesprocedurechild
            :mesproduceprocedureid="
              this.lstSelected != null && this.lstSelected.length > 0
                ? this.lstSelected[0].id
                : 0
            "
          ></mesprocedurechild>
        </el-tab-pane>
        <el-tab-pane label="工艺"> </el-tab-pane>
        <el-tab-pane label="工序动作组">配置管理</el-tab-pane>
        <el-tab-pane label="工序动作库">角色管理</el-tab-pane>
        <el-tab-pane label="工序变量">定时任务补偿</el-tab-pane>
        <el-tab-pane label="工序要求">定时任务补偿</el-tab-pane>
        <el-tab-pane label="观测工时">定时任务补偿</el-tab-pane>
      </el-tabs>
    </el-row>
    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
      <el-form
        ref="dataForm"
        :rules="rules"
        :model="temp"
        label-position="left"
        label-width="120px"
        style="width: 400px; margin-left: 50px"
      >
        <el-form-item label="生成工序线编号" prop="produceProcedureNo">
          <el-input v-model="temp.produceProcedureNo" />
        </el-form-item>
        <el-form-item label="生成工序线名称" prop="produceProcedureName">
          <el-input v-model="temp.produceProcedureName" />
        </el-form-item>
        <el-form-item label="产品类型" prop="productTypeId">
          <el-select
            v-model="temp.productTypeId"
            class="filter-item"
            placeholder="请选择产品类型"
          >
            <el-option
              v-for="item in this.ddProductTypes"
              :key="item.id"
              :label="item.productTypeName"
              :value="item.id"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="状态" prop="status">
          <el-input v-model="temp.status" />
        </el-form-item>
        <el-form-item label="来源" prop="source">
          <el-input v-model="temp.source" />
        </el-form-item>
        <el-form-item label="备注" prop="comment">
          <el-input v-model="temp.comment" />
        </el-form-item>
        <el-form-item label="审核时间" prop="audittime">
          <el-input v-model="audittime" />
        </el-form-item>
        <el-form-item label="审核人" prop="audituser">
          <el-input v-model="temp.audituser" />
        </el-form-item>
        <el-form-item label="创建时间" prop="createtime">
          <el-input v-model="createtime" />
        </el-form-item>
        <el-form-item label="创建人" prop="createuser">
          <el-input v-model="temp.createuser" />
        </el-form-item>
        <el-form-item label="更新时间" prop="updatetime">
          <el-input v-model="updatetime" />
        </el-form-item>
        <el-form-item label="更新人" prop="updateuser">
          <el-input v-model="temp.updateuser" />
        </el-form-item>
        <el-form-item label="删除时间" prop="deletetime">
          <el-input v-model="deletetime" />
        </el-form-item>
        <el-form-item label="删除人" prop="deleteuser">
          <el-input v-model="temp.deleteuser" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false"> 取消 </el-button>
        <el-button
          type="primary"
          @click="dialogStatus === 'create' ? ui_create() : ui_update()"
        >
          确定
        </el-button>
      </div>
    </el-dialog>

    <el-dialog
      :title="textMap.dispatchTxt"
      :visible.sync="dialogDispatchVisible"
    >
      <el-form
        ref="dispatchForm"
        :rules="rules"
        :model="temp"
        label-position="left"
        label-width="120px"
        style="width: 400px; margin-left: 50px"
      >
        <el-form-item label="选择工厂" prop="facctoryId">
          <el-select
            v-model="selectedFactoryId"
            class="filter-item"
            placeholder="请选择工厂"
            @change="handleFactorySelectChange"
          >
            <el-option
              v-for="item in this.ddFactories"
              :key="item.id"
              :label="item.factoryName"
              :value="item.id"
            />
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogDispatchVisible = false"> 取消 </el-button>
        <el-button type="primary" @click="dispatch_create">
          确定
        </el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  getAll,
  getOne,
  getList,
  create,
  update,
  deleteBatch,
 
} from "@/api/procedure/produce/mesProduceProcedure";

import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import { getAll as getAllProductTypes } from "@/api/mesProductType";
import mesprocedurebranchchild from "@/views/procedure/produce/mesproduceBranchChild";
import store from "@/store/index";
import moment from "moment";
import { formatDate } from "@/utils/date";
import mesprocedurechild from "@/views/procedure/produce/mesProcedureChild";
import {
  create as dispatchCreate,
  update as updateDispatch
} from "@/api/procedure/product/modelProductProcedureDispatch";
import { parse } from "path-to-regexp";
import { getAll as getAllFactories } from "@/api/factoryModel/modelProcessFactoryApi";
import { getProductProcedureProcedures } from "@/api/procedure/product/mesProductProcedureBranchProcedure";

export default {
  components: { Pagination, mesprocedurebranchchild, mesprocedurechild },
  data() {
    return {
      list: null,
      listLoading: true,
      total: 0,
      listQuery: {
        page: 1,
        limit: 6,
        pageSizes: [6, 10, 14]
      },
      currentProduceProcedureId: 0,
      dialogFormVisible: false,
      dialogStatus: "",
      textMap: {
        update: "编辑",
        create: "创建"
      },

      //表格變量
      lstSelected: [],
      ddProduceProcedures: [],
      ddProductTypes: [],
      rules: {
        produceProcedureNo: [
          {
            required: true,
            message: "生成工序线编号不能为空！",
            trigger: "change"
          }
        ],
        produceProcedureName: [
          {
            required: true,
            message: "生成工序线名称不能为空！",
            trigger: "change"
          }
        ],
        productTypeId: [
          {
            required: true,
            message: "产品类型不能为空！",
            trigger: "change"
          }
        ],
        status: [
          {
            required: true,
            message: "状态不能为空！",
            trigger: "change"
          }
        ],
        source: [
          {
            required: true,
            message: "来源不能为空！",
            trigger: "change"
          }
        ]
      },
      temp: {
        id: undefined,
        produceProcedureNo: "",
        produceProcedureName: "",
        productTypeId: 0,
        status: "",
        comment: "",
        audittime: "",
        audittime: moment(new Date()).format("YYYY-MM-DD HH:mm:ss"),
        audituser: store.getters.name,
        createtime: moment(new Date()).format("YYYY-MM-DD HH:mm:ss"),
        createuser: store.getters.name,
        updatetime: moment(new Date()).format("YYYY-MM-DD HH:mm:ss"),
        updateuser: store.getters.name,
        deletetime: moment(new Date()).format("YYYY-MM-DD HH:mm:ss"),
        source: "",
        isdeleted: 0,
        produceLineBranchId:0,
        produceLineBranchNo:"",
        produceLineBranchName:"",
      },
      queryConditions: {
        no: "",
        updateStartTime: moment(new Date(1900, 5, 27, 15, 44, 11)).format(
          "YYYY-MM-DD HH:mm:ss"
        ),
        updateEndTime: moment(new Date()).format("YYYY-MM-DD HH:mm:ss"),
        status: -1
      },
      lstStatus: [
        { label: "请选择", value: -1 },
        { label: "已提交", value: 0 },
        { label: "未审核", value: 1 },
        { label: "已审核", value: 2 },
        { label: "审核未通过", value: 3 }
      ],
      selectedNo: "",
      dialogDispatchVisible: false,
      ddFactories: [],
      selectedFactoryId: 0, //所选工厂
      ddProductProcedureProcedures: [], //生产工序线所有的工序
      selectedDatetimeRange: [],
    };
  },
  filters: {
    resolveEnableValue(p) {
      return p ? "是" : "否";
    },
    formatDate(nowTime) {
      var moment = require("moment");
      return moment(nowTime).format("YYYY-MM-DD HH:mm:ss");
    }
  },
  computed: {
    audittime: {
      get() {
        return moment(this.temp.audittime).format("YYYY-MM-DD HH:mm:ss");
      },
      set(val) {
        this.temp.audittime = moment(val).format("YYYY-MM-DD HH:mm:ss");
      }
    },
    createtime: {
      get() {
        return moment(this.temp.createtime).format("YYYY-MM-DD HH:mm:ss");
      },
      set(val) {
        this.temp.createtime = moment(val).format("YYYY-MM-DD HH:mm:ss");
      }
    },
    updatetime: {
      get() {
        return moment(this.temp.updatetime).format("YYYY-MM-DD HH:mm:ss");
      },
      set(val) {
        this.temp.updatetime = moment(val).format("YYYY-MM-DD HH:mm:ss");
      }
    },
    deletetime: {
      get() {
        return moment(this.temp.deletetime).format("YYYY-MM-DD HH:mm:ss");
      },
      set(val) {
        this.temp.deletetime = moment(val).format("YYYY-MM-DD HH:mm:ss");
      }
    }
  },
  watch: {},
  created() {
    this.fetchData();
    this.getAllProductTypes();
    this.getAllProduceProcedures();
    this.getAllFactories();
   // this.getAllProductProcedureBranchProcedures();
  },
  methods: {
    handleSelectionChange(val) {
      this.lstSelected = val;
    },
    fetchData() {
      this.listLoading = true;
      let params = {
        page: this.listQuery.page,
        size: this.listQuery.limit
      };
      params = Object.assign(params, this.queryConditions);
      getList(params).then(response => {
        this.list = response.data.records;
        this.total = response.data.total;
        this.listLoading = false;
      });
    },
    ui_query() {
      this.$loading = true;
      getList(this.queryConditions).then(response => {
        this.list = response.data.records;
        this.total = response.total;
        this.$loading = false;
      });
    },
    ui_create() {
      this.$refs["dataForm"].validate(valid => {
        if (valid) {
          this.temp.id = 0; //自增
          create(this.temp).then(response => {
            this.temp.id = response.data.id;
            this.list.unshift(this.temp);
            this.dialogFormVisible = false;
            this.$notify({
              title: "Success",
              message: "添加成功！",
              type: "success",
              duration: 2000
            });
          });
        }
      });
    },
    ui_update() {
      this.$refs["dataForm"].validate(valid => {
        if (valid) {
          update(this.temp).then(response => {
            //刷新UI
            let index = this.list.findIndex(v => {
              return v.id == response.data.id;
            });
            if (index > -1) {
              this.list.splice(index, 1, this.temp);
            }
            this.dialogFormVisible = false;
            this.$notify({
              title: "Success",
              message: "修改成功！",
              type: "success",
              duration: 2000
            });
          });
        }
      });
    },
    ui_delete(row, index) {
      if (this.lstSelected == null || this.lstSelected.length === 0) {
        this.$message.error("请先选择要删除的工序组");
        return;
      }
      let ids = [];
      this.lstSelected.map(function(elm) {
        ids.push(elm.id);
      });
      deleteBatch(ids).then(() => {
        ids.forEach(elm => {
          const index = this.list.findIndex(v => v.id === elm);
          this.list.splice(index, 1);
        });
        this.dialogFormVisible = false;
        this.$notify({
          title: "Success",
          message: "删除成功！",
          type: "success",
          duration: 2000
        });
      });
    },
    resetTemp() {
      this.temp = {
        id: 0,
        produceProcedureNo: "",
        produceProcedureName: "",
        productTypeId: 0,
        status: "",
        comment: "",
        audittime: moment(new Date()).format("YYYY-MM-DD HH:mm:ss"),
        audituser: store.getters.name,
        createtime: moment(new Date()).format("YYYY-MM-DD HH:mm:ss"),
        createuser: store.getters.name,
        updatetime: moment(new Date()).format("YYYY-MM-DD HH:mm:ss"),
        updateuser: store.getters.name,
        deletetime: moment(new Date()).format("YYYY-MM-DD HH:mm:ss"),
        deleteuser: store.getters.name,
        source: "",
        isdeleted: 0,
        produceLineBranchId:0,
        produceLineBranchNo:"",
        produceLineBranchName:"",
      };
    },
    handleCreate() {
      this.resetTemp();
      this.dialogStatus = "create";
      this.dialogFormVisible = true;
      this.$nextTick(() => {
        this.$refs["dataForm"].clearValidate();
      });
    },
    handleUpdate() {
      if (this.lstSelected == null || this.lstSelected.length == 0) {
        this.$message.error("请先选择一条生产工序线");
        return;
      }
      this.temp = Object.assign({}, this.lstSelected[0]); // copy obj
      this.dialogStatus = "update";
      this.dialogFormVisible = true;
      this.$nextTick(() => {
        this.$refs["dataForm"].clearValidate();
      });
    },

    rowClick(row, column, event) {
      this.lstSelected.length = 0;
      this.lstSelected.push(row);
      this.currentProduceProcedureId = row.id;
    },
    handleMainTypeChange(val) {
      this.getSelParentIdOptions();
    },
    getAllProductTypes() {
      getAllProductTypes().then(response => {
        this.ddProductTypes.push({ id: 0, productTypeName: "请选择" });
        this.ddProductTypes.push(...response.data);
      });
    },
    querySearch(queryString, cb) {
      let produceProcedures = this.ddProduceProcedures;
      let results = queryString
        ? produceProcedures.filter(this.createFilter(queryString))
        : produceProcedures;
      // 调用 callback 返回建议列表的数据
      cb(results);
    },
    createFilter(queryString) {
      return p => {
        return p.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0;
      };
    },
    getAllProduceProcedures() {
      this.ddProduceProcedures.length = 0;
      getAll().then(response => {
        let r = response.data.map(v => {
          return { value: v.produceProcedureNo };
        });
        this.ddProduceProcedures = this.ddProduceProcedures.concat(r);
      });
    },
    handleSelect(val) {
      this.queryConditions.no = val.value;
    },
    handleInput(val) {
      this.queryConditions.no = val;
    },
    handleDateSelectChange(val) {
      this.queryConditions.updateStartTime = moment(val[0]).format(
        "YYYY-MM-DD HH:mm:ss"
      );
      this.queryConditions.updateEndTime = moment(val[1]).format(
        "YYYY-MM-DD HH:mm:ss"
      );
    },
    ui_auditing() {
      if (this.lstSelected == null || this.lstSelected.length == 0) {
        this.$message.error("请先选择一条生产工序线");
        return;
      }
      this.temp = Object.assign({}, this.lstSelected[0]);
      //提交审核
      this.temp.status = 1;
      update(this.temp).then(response => {
        //刷新UI
        let index = this.list.findIndex(v => {
          return v.id == response.data.id;
        });
        if (index > -1) {
          this.list.splice(index, 1, this.temp);
        }
        this.dialogFormVisible = false;
        this.$notify({
          title: "Success",
          message: "提交审核成功！",
          type: "success",
          duration: 2000
        });
      });
    },
    ui_audited() {
      if (this.lstSelected == null || this.lstSelected.length == 0) {
        this.$message.error("请先选择一条生产工序线");
        return;
      }
      this.temp = Object.assign({}, this.lstSelected[0]);
      let text = this.$refs.btnAudited.$el.innerText;
      if (text == "审核") {
        //审核通过
        this.temp.status = 2;
      } else {
        //撤销审核
        this.temp.status = 3;
      }
      update(this.temp).then(response => {
        //刷新UI
        let index = this.list.findIndex(v => {
          return v.id == response.data.id;
        });
        if (index > -1) {
          this.list.splice(index, 1, this.temp);
        }
        this.dialogFormVisible = false;
        if (text == "审核") {
          //审核通过
          this.$refs.btnAudited.$el.innerText = "撤销审核";
        } else {
          //审核撤销
          this.$refs.btnAudited.$el.innerText = "审核";
        }
        this.$notify({
          title: "Success",
          message: text + "成功！",
          type: "success",
          duration: 2000
        });
      });
    },
    resolveStatusValue(p) {
      return this.lstStatus.find(v => {
        return v.value == p;
      }).label;
    },

    handleFactorySelectChange(val) {
      console.log(val);
    },
    //下发
    ui_dispatch() {
      if (this.lstSelected == null || this.lstSelected.length == 0) {
        this.$message.error("请先选择一条产品工序线");
        return;
      }
      this.temp = Object.assign({}, this.lstSelected[0]);
      this.dialogDispatchVisible = true;
    },
    dispatch_create() {
      var param = {
        id: 0,
        productProcedureId: 0,
        factoryId: this.selectedFactoryId,
        produceLineId: this.temp.id,
        createUser: store.getters.name,
        createtime: this.temp.createtime,
        comment: "",
        status: 0, //已提交
        isDeleted: false,
        verson: 1,
        sourceLineType:2 //生产工序线
      };
      debugger;
      dispatchCreate(param).then(response => {
        this.dialogDispatchVisible = false;
        this.$notify({
          title: "Success",
          message: "下发成功！",
          type: "success",
          duration: 2000
        });
      });
    },
    getAllFactories() {
      getAllFactories().then(response => {
        var result = response.data;
        if (result != null && result.length > 0) {
          result.map(v => {
            this.ddFactories.push({ id: v.id, factoryName: v.sfactoryname });
          });
        }
        this.ddFactories.splice(0, 0, {
          id: 0,
          factoryName: "请选择"
        });
      });
    },
    // getAllProductProcedureBranchProcedures() {
    //   let para = {
    //     id: this.temp.id
    //   };
    //   getProductProcedureProcedures(para).then(response => {
    //     let result = response.data;
    //     if (result != null && result.length > 0) {
    //       result.map(v => {
    //         this.ddProductProcedureProcedures.push({
    //           label: v.procedureName,
    //           value: v.id
    //         });
    //       });
    //     }
    //     this.ddProductProcedureProcedures.splice(0, 0, {
    //       label: "请选择",
    //       value: 0
    //     });
    //   });
    // },
    // handleProductProcedureSelectChange(val) {
    //   this.temp.bottleneckProcedureId = val;
    //   let index = this.ddProductProcedureProcedures.findIndex(
    //     v => v.value == val
    //   );
    //   if (index >= 0) {
    //     this.temp.bottleneckProcedureName = this.ddProductProcedureProcedures[
    //       index
    //     ].label;
    //   }
    // }
  }
};
</script>
<style>
.el-row {
  margin-bottom: 20px;
  &:last-child {
    margin-bottom: 0;
  }
}
.el-col {
  border-radius: 4px;
}
.bg-purple-dark {
  background: #99a9bf;
}
.bg-purple {
  background: #d3dce6;
}
.bg-purple-light {
  background: #e5e9f2;
}
.grid-content {
  border-radius: 4px;
  min-height: 36px;
}
.row-bg {
  padding: 10px 0;
  background-color: #f9fafc;
}
</style>
